<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            position: relative;
            margin: 200px auto 0;
            transition: 3s all ease;
            transform: perspective(700px) rotateX(0deg) rotateY(0deg);
            transform-style: preserve-3d;
        }
        .box:active {
            transform: perspective(700px) rotateX(360deg) rotateY(180deg);
        }
        .box div {
            width: 198px;
            height: 198px;
            border: 1px solid black;
            position: absolute;
            left: 0;
            top: 0;
            background-color: #ff5700;
            opacity: 0.7;
        }

        div.front {
            transform: translateZ(100px);
        }
        div.back {
            transform: translateZ(-100px);
        }
        div.left {
            transform: rotateY(-90deg) translateZ(100px);
        }
        div.right {
            transform: rotateY(90deg) translateZ(100px);
        }
        div.top {
            transform: rotateX(90deg) translateZ(100px);
        }
        div.down {
            transform: rotateX(-90deg) translateZ(100px);
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="front">前</div>
        <div class="back">后</div>
        <div class="top">上</div>
        <div class="down">下</div>
        <div class="left">左</div>
        <div class="right">右</div>
    </div>
    <script>
        window.addEventListener('DOMContentLoaded', function() {})
    </script>
</body>
</html>